<template>
    <el-input placeholder="请输入内容" v-model="searchParams.value" class="item-input-with-select" style="width: 40%">
        <el-select v-model="searchParams.type" slot="prepend" placeholder="请选择">
            <el-option label="名称" value="stockName"/>
            <el-option label="类型" value="stockType"/>
        </el-select>
        <el-button slot="append" icon="el-icon-search" @click="doSearch"/>
    </el-input>
</template>

<script>
    import {mapActions, mapState} from "vuex";

    export default {
        computed: {
            ...mapState("item", ["searchParams"]),
        },
        methods: {
            ...mapActions("item", ["listItems"]),
            doSearch() {
                this.listItems();
            },
        },
    };
</script>

<style>
</style>
